package io.demo.command;

/**
 * @author create by zhangpengfei at 2021/9/29 19:34
 */

public class LightOnCommand implements Command{

    Light light;
    Command undoCommand;

    public LightOnCommand(Light light) {
        this.light = light;
    }

    @Override
    public void execute() {
        light.on();
        undoCommand = this;
    }

    @Override
    public void undo() {
        this.execute();
    }
}
